<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="../../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="../../../css/H-ui.admin.css" rel="stylesheet"
	type="text/css" />
<link href="../../../lib/icheck/icheck.css" rel="stylesheet"
	type="text/css" />
<link href="../../../lib/Hui-iconfont/1.0.1/iconfont.css"
	rel="stylesheet" type="text/css" />
	<link href="../../../fileInput/css/fileinput.css"
	rel="stylesheet" type="text/css" />
<link href="../../../login/css/bootstrap.min.css"
	rel="stylesheet" type="text/css" />
<title>添加用户</title>
</head>
<body>
	<div class="pd-20">
		<form class="form form-horizontal" id="form-member-add">

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*
						</span>大棚名称：</label>
				<div class="formControls col-5">
					<input type="text" class="input-text" value="" required="required" placeholder="请填写大棚名称"
						   id="name" name="name">
				</div>
				<div class="col-4"></div>
			</div>

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*
						</span>大棚编号：</label>
				<div class="formControls col-5">
					<input type="text" class="input-text" value="" required="required" placeholder="请填写大棚编号"
						   id="boxNo" name="boxNo">
				</div>
				<div class="col-4"></div>
			</div>

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*
						</span>大棚地址：</label>
				<div class="formControls col-5">
					<input type="text" class="input-text" value="" required="required" placeholder="请填写大棚地址"
						   id="address" name="address">
				</div>
				<div class="col-4"></div>
			</div>

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*
						</span>大棚面积：</label>
				<div class="formControls col-5">
					<input type="number" class="input-text" value="" required="required" placeholder="请填写面积"
						   id="area" name="area">
				</div>
				<div class="col-4"></div>
			</div>

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*
						</span>描述：</label>
				<div class="formControls col-5">
					<input type="text" class="input-text" value="" required="required" placeholder="请填写描述"
						   id="desc" name="desc">
				</div>
				<div class="col-4"></div>
			</div>

			<input type="hidden" id="hotelUserId" name="hotelUserId">
			<div class="row cl">
				<div class="col-9 col-offset-3">
					<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
				</div>
			</div>

		</form>
	</div>
	<script type="text/javascript"
		src="../../../js/jquery-3.3.1.js"></script>
	<script type="text/javascript"
		src="../../../lib/icheck/jquery.icheck.min.js"></script>
	<script type="text/javascript"
		src="../../../lib/Validform/5.3.2/Validform.min.js"></script>
	<script type="text/javascript" src="../../../lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="../../../js/H-ui.js"></script>
	<script type="text/javascript" src="../../../js/H-ui.admin.js"></script>
	<script type="text/javascript" src="../../../fileInput/js/fileinput.js"></script>
	<script type="text/javascript" src="../../../fileInput/js/locales/zh.js"></script>
	<script type="text/javascript">
	

	
		$(function() {
			
			$("#form-member-add").Validform({
				tiptype : 2,
				callback : function(form) {
					var index = layer.load(2);
					
					var formData = $("#form-member-add").serialize();
					
					$.ajax({
						url : "../../../../greenhouse/save",
						data : formData,
						dataType : "text",
						type : "get",
						success : function(data) {
							console.log(data);
							layer.close(index);
							 if (data == "success"){
								layer.msg('新增成功！', {
									icon : 6
								},function (){
									var parentIndex = parent.layer.getFrameIndex(window.name);
									parent.$('.btn-refresh').click();
									parent.layer.close(parentIndex);
									parent.location.reload();
								});
							}else{
								layer.msg("新增失败", {
									icon : 5
								},function (){
								});
							}
						}
					});
					return false;
				}
			});

		});
		
		

		
		// 获取url参数
		function GetQueryString(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if (r != null)
				return unescape(r[2]);
			return null;
		}
	</script>
</body>
</html>